'''
Utility class to help handling GZIP base 64 data
'''

from base64 import b64decode
import StringIO
import gzip


class GZIPUtil(object):
    
    @classmethod
    def unzip(cls, b64data):
        gzipSub = b64decode(b64data)
        compressedstream = StringIO.StringIO(gzipSub)
        gzipper = gzip.GzipFile(fileobj=compressedstream)
        return gzipper.read()  

